package framework.util.queryFilter.dao;

import framework.util.queryFilter.service.impl.QueryFilter;
import framework.util.queryFilter.vo.Delete;
import framework.util.queryFilter.vo.Insert;
import framework.util.queryFilter.vo.Update;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * myBatis的查询框架
 *
 * @author 吴宇亮 2019/2/7 0007 17:53
 */
public interface IBaseDao<BoType, LidType> {

    LinkedHashMap get(@Param("sql") String sql, @Param("_q") Map<String, Object> paramMap);

    List<LinkedHashMap> getAll(@Param("filter") QueryFilter filter, @Param("_q") Map<String, Object> paramMap);

    Integer getTotals(@Param("filter") QueryFilter filter, @Param("_q") Map<String, Object> paramMap);

    void addBatch(@Param("list") List<Insert<BoType>> list);

    void removeByQueryFilter(@Param("filter") QueryFilter filter, @Param("_q") Map<String, Object> paramMap);

    void removeBatch(@Param("delete") Delete<LidType> delete);

    void update(@Param("update") Update<BoType> update, @Param("bo") BoType bo);


}
